<template>
    <u-tabbar :value="valueModel" :fixed="true" :placeholder="true" z-index='9999'
        :safeAreaInsetBottom="true" :border="false">
		<block v-for="(item,index) in footerArr" :key='index'>
			<u-tabbar-item :text="item.menu_name" :icon="item.this_icon" @click="clickItem(item,index)"></u-tabbar-item>
		</block>
    </u-tabbar>
</template>

<script>
    export default {
        name: "u-tabbar-own",
        data() {
            return {};
        },
        props: {
            valueModel: {
                type: Number,
                default: 0
            },
			footerArr: {
				type: Array,
				default: []
			}
        },
        created() {
            // 是否隐藏原生tabbar
            uni.hideTabBar();
        },
        mounted() {

        },
        methods: {
            clickItem(item,index) {
				this.$emit('clickItemUpdate',index)
				this.$nextTick(function(){
					uni.reLaunch({
						url: this.footerArr[index].page_url +'?id=' + index
					})
					uni.setStorageSync('tarbar_index',index)
					
				})
            },
        }
    }
</script>

<style lang="scss" scoped>
    .f-fixed {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }
</style>
